<include file="public@header" />
</head>
<body>
    <div class="layui-fluid js-check-wrap">
        <div class="row">
            <div class="layui-col-xs6">
                <h2>{:lang('ADMIN_AUDITFLOW_INDEX')}</h2>
            </div>
            <div class="layui-col-xs6 text-right">
                <!-- 添加分类 -->
                <if condition="in_array('add', $actions)">
                    <a href="{:url('AuditFlow/add')}" class="layui-btn layui-btn-normal">{:lang('ADMIN_AUDITFLOW_ADD')}</a>
                </if>
            </div>
        </div>
        <div class="layui-card-body">
            <table class="layui-table">
                <thead>
                    <tr>
                        <th width="50">ID</th>
                        <th>{:lang('AUDIT_FLOW_NAME')}</th>
                        <th>{:lang('DESCRIPTION')}</th>
                        <th>创建人</th>
                        <th>{:lang('STATUS')}</th>
                        <th width="">{:lang('ACTIONS')}</th>
                    </tr>
                </thead>
                <tbody>
                    <php>

                    </php>
                    <foreach name="lists" item="vo">
                    <tr>
                        <td>{$vo.audit_id}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.description}</td>
                        <td>{$vo.role_name}</td>
                        <td>
                            <notempty name="vo.status">
                                <span class="layui-btn layui-btn-normal layui-btn-xs">{:lang('ENABLED')}</span>
                                <else/>
                                <span class="layui-btn layui-btn-xs layui-btn-danger">{:lang('DISABLED')}</span>
                            </notempty>
                            <!-- {:lang('AUDIT_FLOW_STATUS')[$vo.status]} -->
                        </td>
                        <td>
                            <if condition="cmf_auth_check(cmf_get_current_admin_id(), 'admin/AuditFlowStep/index')">
                                <a href="javascript:parent.openIframeLayer('{:url('audit_flow_step/index',array('audit_id'=>$vo['audit_id']))}','设置审核步骤',{area: ['800px', '500px']});">设置审核步骤</a>
                            </if>
                            <if condition="in_array('edit', $actions)">
                                <a href="{:url('auditFlow/edit',array('id'=>$vo['audit_id']))}">{:lang('EDIT')}</a>
                            </if>
                            <if condition="in_array('toggleStatus', $actions)">
                                <if condition="$vo.status eq 1">
                                    <a href="{:url('auditFlow/toggleStatus',array('id'=>$vo['audit_id']))}" class="js-ajax-dialog-btn"
                                   data-msg="确定要禁用该审核流程吗？">{:lang('DISABLED')}</a>
                                <else />
                                    <a href="{:url('auditFlow/toggleStatus',array('id'=>$vo['audit_id']))}" class="js-ajax-dialog-btn"
                                   data-msg="确定要开启该审核流程吗？">{:lang('ENABLED')}</a>
                                </if>
                            </if>
                            <if condition="in_array('delete', $actions)">
                                <a href="{:url('auditFlow/delete',array('id'=>$vo['audit_id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
                            </if>
                        </td>
                    </tr>
                    </foreach>
                </tbody>
            </table>
        </div>
    </div>

<include file="public@footer"/>
